package com.chen.shopping_common.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chen.shopping_common.pojo.Orders;
import com.chen.shopping_common.pojo.SeckillGoods;

public interface SeckillService {

    //前台用户分页查询秒杀商品
    Page<SeckillGoods> findPageByRedis(int page,int size) throws InterruptedException;
    //查询秒杀商品详情
    SeckillGoods findSeckillGoodsByRedis(Long goodsId);
    //生成秒杀订单
    Orders addSeckillGoodsOrder(Orders orders);
    //根据id查询秒杀订单
    Orders findByOrderId(String orderId);
    //支付秒杀订单
    Orders pay(String orderId);
    //向Redis中添加秒杀商品
    void addSeckillGoodsToRedis(SeckillGoods seckillGoods);
    //向Mysql中查询秒杀商品详情
    SeckillGoods findSeckillGoodsByMysql(Long goodsId);
}
